package common.statusenum;

import java.util.HashMap;

/**
 * 合同计费枚举
 *
 * @author yuanqinglong
 * @since 2020/9/8 9:50
 */
public enum BillingEnum {
    /**
     * 合同计费方式：1单条，2包量，3包企业数
     */
    SINGLE_BILLING(BillingEnum.SINGLE_BILLING_CODE, "单条"),
    COMBINATION_BILLING(BillingEnum.COMBINATION_BILLING_CODE, "包量"),
    ENTERPRISE_BILLING(BillingEnum.ENTERPRISE_BILLING_CODE, "包企业数");

    public static final String SINGLE_BILLING_CODE = "1";
    public static final String COMBINATION_BILLING_CODE = "2";
    public static final String ENTERPRISE_BILLING_CODE = "3";

    private final String code;
    private final String msg;

    BillingEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    public String getCode() {
        return this.code;
    }


    public String getMsg() {
        return this.msg;
    }

    static HashMap<String, String> map = new HashMap(32);

    static {
        for (BillingEnum value : BillingEnum.values()) {
            map.put(value.code, value.msg);
        }
    }

    public static String getMsgByCode(String code) {
        return map.get(code);
    }

}
